//数据层
var mongoose = require("mongoose");
var db = require('./db');
var orderModel = db.model("order",new mongoose.Schema({
    orderNumber:{
        type: String,
        required: true
    },
    state:{//0:锁定待支付,1：未锁定待支付，2：已支付完成，3：部分乘客退订还有没退订的,4：已取消&&退订,
        type: Number,
        default: 0,
    },
    username:{
        type: String,
        required: true
    },
    payWay:{
        type: Number,
        default: 0
    },
    ticketingTime:{
        type: String,
        required: true
    },
    company:{
        type: String,
        required: true
    },
    start:{
        type: Object,
        required: true
    },
    end:{
        type: Object,
        required: true
    },
    number:{
        type:Number,
        required: true,
    },
    classType:{
        type: Number,
        required: true
    },
    passenger:{
        type: Array,
        required: true
    },
    contact:{
        type: Object,
        required: true
    },
    deleted:{
        type: Boolean,
        default: false
    }
}),"order");

module.exports = orderModel;